//
//  ZCOrderCheckGoodsInfoCell.m
//  ZCJZ
//
//  Created by sujeking on 2019/2/27.
//  Copyright © 2019年 jeking. All rights reserved.
//

#import "ZCOrderCheckGoodsInfoCell.h"
#import <UIImageView+WebCache.h>

@interface ZCOrderCheckGoodsInfoCell()

@property (weak, nonatomic) IBOutlet UIImageView *imv;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *sizeLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;

@end


@implementation ZCOrderCheckGoodsInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
//    self.clipsToBounds = YES;
//    self.layer.cornerRadius = 8;
    
}

- (void)setFrame:(CGRect)frame{
    frame.origin.x += 10;
    frame.size.width -= 20;
    [super setFrame:frame];
    [self layoutIfNeeded];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (void)setDict:(NSDictionary *)dict {
    _dict = dict;
    [self.imv sd_setImageWithURL:[NSURL URLWithString:[dict valueForKey:@"goods_thumb"]]
                placeholderImage:[UIImage imageNamed:@"picon"] options:SDWebImageAllowInvalidSSLCertificates];
    self.countLabel.text = [NSString stringWithFormat:@"x%@",[dict valueForKey:@"nums"]];
    self.priceLabel.text = [NSString stringWithFormat:@"￥%@",[dict valueForKey:@"shop_price"]];

    self.sizeLabel.text = [dict valueForKey:@"sku_properties_name"];
    self.titleLabel.text = [dict valueForKey:@"goods_name"];
    
    if ([dict valueForKey:@"sku_properties_name"] != nil) {
        self.sizeLabel.text = [dict valueForKey:@"sku_properties_name"];
    }
    if ([dict valueForKey:@"goods_name"] != nil) {
        self.titleLabel.text = [dict valueForKey:@"goods_name"];
    }
    if ([dict valueForKey:@"goods_title"] != nil) {
        self.titleLabel.text = [dict valueForKey:@"goods_title"];
    }
    
    if ([dict valueForKey:@"properties_name"] != nil) {
        self.sizeLabel.text = [dict valueForKey:@"properties_name"];
    }
}

@end
